package com.bawei.library_base.room.good;

import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

/**
 * @author : zhiyu
 * @date : 2021/12/16
 * @content :
 */

@Entity
public class Good {
    @PrimaryKey(autoGenerate = true)//主键是否自增，默认为flase
    private Long id;

    //商品名称
    private String name;
    //商品价格
    private String price;
    //商品图片
    private String imgUrl;
    //商品的id
    private long good_id;
    //添加数量
    private int count=0;
    //是否选中
    private boolean check=false;


    @Override
    public String toString() {
        return "Good{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price='" + price + '\'' +
                ", imgUrl='" + imgUrl + '\'' +
                ", good_id=" + good_id +
                ", count=" + count +
                ", check=" + check +
                '}';
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public long getGood_id() {
        return good_id;
    }

    public void setGood_id(long good_id) {
        this.good_id = good_id;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public boolean isCheck() {
        return check;
    }

    public void setCheck(boolean check) {
        this.check = check;
    }

    public Good() {
    }

    @Ignore
    public Good(Long id, String name, String price, String imgUrl, long good_id, int count, boolean check) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.imgUrl = imgUrl;
        this.good_id = good_id;
        this.count = count;
        this.check = check;
    }
}
